<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>tmrctr: Main Page</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">tmrctr
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('index.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">tmrctr Documentation</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The Xilinx timer/counter component. This component supports the Xilinx timer/counter. More detailed description of the driver operation can be found in the <a class="el" href="xtmrctr_8c.html">xtmrctr.c</a> file.</p>
<p>The Xilinx timer/counter supports the following features:</p>
<ul>
<li>Polled mode.</li>
<li>Interrupt driven mode</li>
<li>enabling and disabling specific timers</li>
<li>PWM operation</li>
<li>Cascade Operation (This is to be used for getting a 64 bit timer and this feature is present in the latest versions of the axi_timer IP)</li>
</ul>
<p>The timer counter operates in 2 primary modes, compare and capture. In either mode, the timer counter may count up or down, with up being the default.</p>
<p>Compare mode is typically used for creating a single time period or multiple repeating time periods in the auto reload mode, such as a periodic interrupt. When started, the timer counter loads an initial value, referred to as the compare value, into the timer counter and starts counting down or up. The timer counter expires when it rolls over/under depending upon the mode of counting. An external compare output signal may be configured such that a pulse is generated with this signal when it hits the compare value.</p>
<p>Capture mode is typically used for measuring the time period between external events. This mode uses an external capture input signal to cause the value of the timer counter to be captured. When started, the timer counter loads an initial value, referred to as the compare value,</p>
<p>The timer can be configured to either cause an interrupt when the count reaches the compare value in compare mode or latch the current count value in the capture register when an external input is asserted in capture mode. The external capture input can be enabled/disabled using the XTmrCtr_SetOptions function. While in compare mode, it is also possible to drive an external output when the compare value is reached in the count register The external compare output can be enabled/disabled using the XTmrCtr_SetOptions function.</p>
<p><b>Interrupts</b></p>
<p>It is the responsibility of the application to connect the interrupt handler of the timer/counter to the interrupt source. The interrupt handler function, XTmrCtr_InterruptHandler, is visible such that the user can connect it to the interrupt source. Note that this interrupt handler does not provide interrupt context save and restore processing, the user must perform this processing.</p>
<p>The driver services interrupts and passes timeouts to the upper layer software through callback functions. The upper layer software must register its callback functions during initialization. The driver requires callback functions for timers.</p>
<dl class="section note"><dt>Note</dt><dd>The default settings for the timers are:<ul>
<li>Interrupt generation disabled</li>
<li>Count up mode</li>
<li>Compare mode</li>
<li>Hold counter (will not reload the timer)</li>
<li>External compare output disabled</li>
<li>External capture input disabled</li>
<li>Pulse width modulation disabled</li>
<li>Timer disabled, waits for Start function to be called <br/>
<br/>
 A timer counter device may contain multiple timer counters. The symbol XTC_DEVICE_TIMER_COUNT defines the number of timer counters in the device. The device currently contains 2 timer counters. <br/>
<br/>
 This driver is intended to be RTOS and processor independent. It works with physical addresses only. Any needs for dynamic memory management, threads or thread mutual exclusion, virtual memory, or cache control must be satisfied by the layer above this driver.</li>
</ul>
</dd></dl>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a ecm  08/16/01 First release
1.00b jhl  02/21/02 Repartitioned the driver for smaller files
1.10b mta  03/21/07 Updated to new coding style.
1.11a sdm  08/22/08 Removed support for static interrupt handlers from the MDD
              file
2.00a ktn  10/30/09 Updated to use HAL API's. _m is removed from all the macro
              definitions.
2.01a ktn  07/12/10 Renamed the macro XTimerCtr_ReadReg as XTmrCtr_ReadReg
              for naming consistency (CR 559142).
2.02a sdm  09/28/10 Updated the driver tcl to generate the xparameters
              for the timer clock frequency (CR 572679).
2.03a rvo  11/30/10 Added check to see if interrupt is enabled before further
              processing for CR 584557.
2.04a sdm  07/12/11 Added support for cascade mode operation.
                      The cascade mode of operation is present in the latest
              versions of the axi_timer IP. Please check the HW
              Datasheet to see whether this feature is present in the
              version of the IP that you are using.
2.05a adk  15/05/13 Fixed the CR:693066
              Added the IsStartedTmrCtr0/IsStartedTmrCtr1 members to the
              <a class="el" href="struct_x_tmr_ctr.html" title="The XTmrCtr driver instance data. ">XTmrCtr</a> instance structure.
              The IsStartedTmrCtrX will be assigned XIL_COMPONENT_IS_STARTED in
              the XTmrCtr_Start function.
              The IsStartedTmrCtrX will be cleared in the XTmrCtr_Stop function.
              There will be no Initialization done in the
              XTmrCtr_Initialize if both the timers have already started and
              the XST_DEVICE_IS_STARTED Status is returned.
              Removed the logic in the XTmrCtr_Initialize function
              which was checking the Register Value to know whether
              a timer has started or not.
3.0   adk  19/12/13 Updated as per the New Tcl API's
4.0   als  09/30/15 Updated initialization API.
4.1   sk   11/10/15 Used UINTPTR instead of u32 for Baseaddress CR# 867425.
                    Changed the prototype of XTmrCtr_CfgInitialize API.
4.2   nsk  15/09/16 Updated tcl, to get correct device id for canonical defines,
                    when there exist more than one timer perepheral
      ms   01/23/17 Added xil_printf statement in main function for all
                    examples to ensure that "Successfully ran" and "Failed"
                    strings are available in all examples. This is a fix
                    for CR-965028.
      ms   03/17/17 Added readme.txt file in examples folder for doxygen
                    generation.
4.4   ms   04/18/17 Modified tcl file to add suffix U for all macros
                    definitions of tmrctr in xparameters.h
4.5   cjp  03/22/18 Added APIs to support PWM feature. XTmrCtr_PwmConfigure
                    is used to configure PWM to operate for specific period
                    and high time. XTmrCtr_PwmEnable and XTmrCtr_PwmDisable
                    are used to enable/disable the PWM output.
4.6   mus  03/13/19 tmrctr_tapp tcl is updated to support scenario where
                    AXI TIMER is interrupting ARM processor through more
                    than one interrupt pin. Fix for CR#1024699
4.7   mus  08/31/20 Updated makefile to support parallel make and
                    incremental builds. It would help to reduce
                    compilation time.
4.8   dp   02/12/21 Fix compilation errors that arise when -Werror=conversion
                    is enabled in compilation flags.
4.10  adk  27/12/22 Updated addtogroup tag.
4.11  adk  04/14/23 Added support for system device-tree flow.
</pre> </div></div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
